-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issue #15838
Conversation
c2de26f
to
aa365a9
Compare
aa365a9
to
691d05e
Compare
3905f36
to
52c04d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
@Mergifyio backport stable/10.0 |
✅ Backports have been created
|
52c04d6
to
cb69832
Compare
ci:rerun |
cb69832
to
0737bf8
Compare
ci:rerun |
0737bf8
to
6e4b42f
Compare
ci:rerun |
6e4b42f
to
9c3c225
Compare
9c3c225
to
a653cce
Compare
a653cce
to
06dea23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
06dea23
to
5361f90
Compare
…t issues whith the following config router bgp 65001 no bgp ebgp-requires-policy neighbor 192.168.1.2 remote-as external neighbor 192.168.1.2 timers 3 10 ! address-family ipv4 unicast neighbor 192.168.1.2 route-map r2 in exit-address-family exit ! bgp as-path access-list FIRST seq 5 permit ^65 bgp as-path access-list SECOND seq 5 permit 2$ ! route-map r2 permit 6 match ip address prefix-list p2 set as-path exclude as-path-access-list SECOND exit ! route-map r2 permit 10 match ip address prefix-list p1 set as-path exclude 65003 exit ! route-map r2 permit 20 match ip address prefix-list p3 set as-path exclude all exit making some no bgp as-path access-list SECOND permit 2$ bgp as-path access-list SECOND permit 3$ clear bgp * no bgp as-path access-list SECOND permit 3$ bgp as-path access-list SECOND permit 2$ clear bgp * will induce some crashes thus we rework the links between aslists and aspath_exclude Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
add some match in route map rules add some set unset bgp access path list add another prefix for better tests discrimination update expected results Signed-off-by: Francois Dumontet <francois.dumontet@6wind.com>
5361f90
to
0df2e14
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
void as_exclude_remove_orphan(struct aspath_exclude *ase) | ||
{ | ||
if (as_list_list_count(&as_exclude_list_orphan)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it necessary to have this test? Why not just delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
orphan list may be destroyed before the as_path_exclude that we are destroying currently.
this occurs at termination time.
this test verify the existence of the list .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, waiting on comments by other reviewers
I think we need to address @donaldsharp 's comment before merging (?) |
Are you interested in this fix? |
@donaldsharp just wanted to check it before we merge ... |
@Mergifyio backport dev/10.1 |
✅ Backports have been created
|
bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issue (backport #15838)
bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issue (backport #15838)
bgpd: fix "bgp as-pah access-list" with "set aspath exclude" set/unset issues
whith the following config
router bgp 65001
no bgp ebgp-requires-policy
neighbor 192.168.1.2 remote-as external
neighbor 192.168.1.2 timers 3 10
!
address-family ipv4 unicast
neighbor 192.168.1.2 route-map r2 in
exit-address-family
exit
!
bgp as-path access-list FIRST seq 5 permit ^65
bgp as-path access-list SECOND seq 5 permit 2$
!
route-map r2 permit 6
match ip address prefix-list p2
set as-path exclude as-path-access-list SECOND
exit
!
route-map r2 permit 10
match ip address prefix-list p1
set as-path exclude 65003
exit
!
route-map r2 permit 20
match ip address prefix-list p3
set as-path exclude all
exit
making some
no bgp as-path access-list SECOND permit 2$
bgp as-path access-list SECOND permit 3$
clear bgp *
no bgp as-path access-list SECOND permit 3$
bgp as-path access-list SECOND permit 2$
clear bgp *
will induce some crashes
thus we rework the links between aslists and aspath_exclude
Signed-off-by: Francois Dumontet francois.dumontet@6wind.com